package com.hs.service;

import com.hs.dao.ClassLessonMapper;
import com.hs.dao.YxClassMapper;
import com.hs.entity.ClassLesson;
import com.hs.entity.YxClass;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;

@Service
public class ClassLessonService {
    @Autowired
    ClassLessonMapper classLessonMapper;
    @Transactional
    public int insertSelective(ClassLesson record){
        record.setCreateTime(new Date());
        int i = classLessonMapper.insertSelective(record);
        if(i == 0){
            throw new RuntimeException("插入失败");
        }
        return  i;
    }
    public int updateByPrimaryKeySelective(ClassLesson record){
        int i = classLessonMapper.updateByPrimaryKeySelective(record);
        if(i == 0){
            throw new RuntimeException("更新失败");
        }
        return  i;
    }


}
